package com.homwee.tvap.common.comSettingInterface;

import android.content.Context;
import android.util.Log;

//zcj 2018-10-30 import com.changhong.android.tvapi.common.vo.DvbProgramInfo;
//zcj 2018-10-30 import com.changhong.android.tvapi.common.vo.EnumInputSource;
//zcj 2018-10-30 import com.changhong.tvos.service.TvChannelManager;
//zcj 2018-10-30 import com.changhong.tvos.service.TvCiManager;
//zcj 2018-10-30 import com.changhong.tvos.service.TvCommonManager;
//zcj 2018-10-30 import com.changhong.tvos.service.TvFactoryManager;
//import com.changhong.tvos.common.MiscManager;
//import com.changhong.tvos.common.TVManager;
//import com.changhong.tvos.common.exception.DTVNotSupportException;
//zcj 2018-10-30 import com.changhong.tvos.service.TvMiscManager;

//page 10
public class factoryPage10{
//	private static MiscManager miscManager;
	//zcj 2018-10-30	private TvMiscManager mTvMiscManager = null;
	//zcj 2018-10-30	private TvFactoryManager mTvFactoryManager = null;
	//zcj 2018-10-30	private TvChannelManager mTvChannelManager = null;
	//zcj 2018-10-30	private TvCommonManager mTvCommonManager = null;
	//zcj 2018-10-30private TvCiManager mTvCiManager = null;
	static factoryPage10 Interface =null;
	MenuConfigManager mCfg =MenuConfigManager.getInstance(null);

	private factoryPage10(Context context){
//		TVManager tvManager = TVManager.getInstance(context);
		try {
//			miscManager = tvManager.getMiscManager();
			//zcj 2018-10-30		mTvMiscManager =TvMiscManager.getInstance();
			//zcj 2018-10-30	mTvFactoryManager =TvFactoryManager.getInstance();
			//zcj 2018-10-30	mTvChannelManager = TvChannelManager.getInstance();
			//zcj 2018-10-30	mTvCiManager = TvCiManager.getInstance();
			//zcj 2018-10-30	mTvCommonManager = TvCommonManager.getInstance();
		} catch (Exception e) {
			// TODO: handle exception
			Log.v("tv","miscManager ==null");
		}
	} 
	
	public static factoryPage10 getInstance(Context context){
		if(Interface ==null){
			Interface = new factoryPage10(context);
		}
		return Interface;
	}
	
	public String getDTVMidVersion(){
		String midVersion =null;
		/*//zcj 2018-10-30if(mTvMiscManager !=null){
			try {
			//	midVersion =mTvMiscManager.getDTVMWVersion();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		if(midVersion ==null){
			midVersion ="0.0"; 
		}*/
		return midVersion;
	}
	
	public String getCIState(){
		String CIState =null;
		/*//zcj 2018-10-30if(mTvMiscManager !=null){
			try {
		//		CIState =mTvMiscManager.getDTVCardStatus();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		if(CIState ==null){
			CIState ="unknow";
		}*/
		return CIState;
	}
	
	public void setDTVCIplus(){

	}
	
	
	public boolean IsDTVSource(){
		
		/*//zcj 2018-10-30EnumInputSource currentSource=mTvCommonManager.getCurrentInputSource();
		if(currentSource==EnumInputSource.E_INPUT_SOURCE_DTV||
		   currentSource==EnumInputSource.E_INPUT_SOURCE_DTV2||
		   currentSource==EnumInputSource.E_INPUT_SOURCE_DTV3
				){
			return true;
		}else{
			return false;
		}
		
		*/
		return false;
	}
	
	public int getDVBCVideoPid()   {
		// TODO Auto-generated method stub		
		/*zcj 2018-10-30DvbProgramInfo temp=null;
		try {
			temp = mTvChannelManager.getDvbProgramInfo();
		} catch (RemoteException e) {
		// TODO Auto-generated catch block
			e.printStackTrace();
			return -1;
		}
					
		return  temp.videopid;*/
		return 0;
	}
	
	public int getDVBCAudioPid()   {
		// TODO Auto-generated method stub		
		/*zcj 2018-10-30DvbProgramInfo temp=null;
		try {
		temp = mTvChannelManager.getDvbProgramInfo();
		} catch (RemoteException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return -1;
		}
					
		return  temp.audiopid;*/
		return 0;
	}
	
	
	public int getDVBCPcrPid()   {
		// TODO Auto-generated method stub		
		/*zcj 2018-10-30
		 * DvbProgramInfo temp=null;
		try {
			temp = mTvChannelManager.getDvbProgramInfo();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return -1;
		}
					
		return  temp.pcrpid;*/
		return 0;
	}
	
	
	
	
	public int getDVBCfastScanEnable() {
		// TODO Auto-generated method stub
		int temp=0;
		/*//zcj 2018-10-30 try {
			 temp=mTvFactoryManager.getDvbcFastScanEnable()?1:0;
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		return temp;
	}
	
	
	public void setDVBCfastScanEnable(int value) {
		// TODO Auto-generated method stub
		boolean temp=(value!=0);
		
		/*//zcj 2018-10-30 try {
			  mTvFactoryManager.setDvbcFastScanEnable(temp);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
	
	}
	
	
	public int getDvbsSIParserType() {
		// TODO Auto-generated method stub
		int temp=0;
		/*//zcj 2018-10-30 try {
			 temp=mTvFactoryManager.getDvbsSIParserType()?1:0;
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		return temp;
	}
	
	

	public void setDvbsSIParserType(int value) {
		// TODO Auto-generated method stub
		boolean temp=(value!=0);
		/*//zcj 2018-10-30 
		try {
			 mTvFactoryManager.setDvbsSIParserType(temp);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		*/
	
	}
	
	public int getFreeViewLogo() {
		// TODO Auto-generated method stub
		int temp=0;
		/*//zcj 2018-10-30 try {
			 temp=mTvFactoryManager.getFreeViewLogo()?1:0;
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
		return temp;
	}
	
	
	public void setFreeViewLogo(int value) {
		// TODO Auto-generated method stub
		boolean temp=(value!=0);
		/*//zcj 2018-10-30 
		try {
			mTvFactoryManager.setFreeViewLogo(temp);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
	
	}
	
	
	public void setPerformanceMonitor(int value) {
		// TODO Auto-generated method stub
		
		//zcj 2018-10-30 mTvCiManager.enablePerformanceMonitor(value!=0);
		
	
	}
	
	
	public void setCIDebugLevel(int index ,int value) {
		// TODO Auto-generated method stub	
		//zcj 2018-10-30 mTvCiManager.setCIDebugLevel(index, value);
		
	
	}
	
	
}